package com.cndw.kungfu.vo;

import java.util.HashMap;
import java.util.Map;

import com.cndw.kungfu.domain.Player;
import com.cndw.kungfu.model.Context;
import com.cndw.kungfu.model.disciple.domain.Disciple;
import com.cndw.kungfu.model.disciple.domain.DiscipleMode;
import com.cndw.kungfu.model.player.FormulaDisciple;

/**
 * 玩家徒弟的VO
 * @author fantadust [9677889@qq.com]
 * @date 2011-6-28 上午10:57:39
 */
public class DiscipleVO {
	/**
	 * 唯一编号
	 */
	private int id;
	/**
	 * 玩家id
	 */
	private long playerId;
	/**
	 * 徒弟名字
	 */
	private String name;
	/**
	 * 徒弟品质
	 */
	private int quality;

	/**
	 * 图片
	 */
	private int icon;
	/**
	 * 特性类型
	 */
	private int featureType;
	/**
	 * 特性等级
	 */
	private int featureLevel;
	/**
	 * 资质类型
	 */
	private int qualifiedType;
	
	/**
	 * 徒弟等级
	 */
	private int level;
	/**
	 * 经验
	 */
	private long exp;
	private int power;
	private int physical;
	private int agile;
	private int wit;
	
	private int growth;
	
	private int powerPercent;
	private int physicalPercent;
	private int agilePercent;
	private int witPercent;
	
	private int[] percentMax;
	
	private int powerAdd;
	private int physicalAdd;
	private int agileAdd;
	private int witAdd;	
	
	/**
	 * 评分
	 */
	private int score;
	/**
	 * 天赋数组对象
	 */
	private Map<Integer, Integer> dowerMap = new HashMap<Integer, Integer>();
	/**
	 * 创建时间
	 */
	private int createTime;
	/**
	 * 助阵营id
	 */
	private int campId;
	/**
	 * 特训次数
	 */
	private int devilTimes;
	/**
	 * 独门武功编号
	 */
	private int gestSign;

	
	/**
	 * 升级需要经验
	 */
	private long expNeed;
	
	private int[] addV;


	
	
	public DiscipleVO(Disciple disciple) {
		id = disciple.getId();
		playerId = disciple.getPlayerId();
		name = disciple.getName();
		quality = disciple. getQuality();
		icon = disciple.getIcon();
		featureType = disciple.getFeatureType();
		featureLevel = disciple.getFeatureLevel();
		
		DiscipleMode discipleMode = disciple.getDiscipleMode();
		qualifiedType = discipleMode.getQualifiedType();
		int[] qf = discipleMode.getQualifiedFloatArr();	
		percentMax = new int[]{qf[1],qf[3],qf[5],qf[7]};	
		
		
		level = disciple.getLevel();
		exp = disciple.getExp();
		power = disciple.getPower();
		physical = disciple.getPhysical();
		agile = disciple.getAgile();
		wit = disciple.getWit();
		growth = disciple.getGrowth();
		
		powerAdd = disciple.getPowerAdd();
		physicalAdd = disciple.getPhysicalAdd();
		agileAdd = disciple.getAgileAdd();
		witAdd = disciple.getWitAdd();
		powerPercent = disciple.getPowerPercent();
		physicalPercent = disciple.getPhysicalPercent();
		agilePercent = disciple.getAgilePercent();
		witPercent = disciple.getWitPercent();		

		createTime = disciple.getCreateTime();	
		campId = disciple.getCampId();		
		dowerMap = disciple.getDowerMap();		
		expNeed = disciple.getExpNeed();

		score = disciple.getScore();
		
		devilTimes = disciple.getDevilTimes();
		
		gestSign = disciple.getGestSign();
		
		Player player = Context.getPlayerServer().getByPlayerId(playerId);
		if (player != null) {
			addV = FormulaDisciple.clcaFirstProperties(disciple, player.getVocationId());			
		}
//		if (gestSign > 0 ) {
//			int[] gestAdd  = DiscipleConfig.gestAddMap.get(gestSign);
//			if (addV == null) {
//				addV = new int[15];
//			}
//			addV[1]+= gestAdd[5];
//			addV[2]+= gestAdd[7];
//			addV[3]+= gestAdd[6];
//			addV[4]+= gestAdd[2];
//			addV[5]+= gestAdd[9];
//			addV[6]+= gestAdd[4];			
//			addV[7]+= gestAdd[1];
//			addV[8]+= gestAdd[3];
//			addV[9]+= gestAdd[8];
//		}
		
	}
	

	
	public int getDevilTimes() {
		return devilTimes;
	}



	public void setDevilTimes(int devilTimes) {
		this.devilTimes = devilTimes;
	}



	public int getGestSign() {
		return gestSign;
	}



	public void setGestSign(int gestSign) {
		this.gestSign = gestSign;
	}



	public int getPowerAdd() {
		return powerAdd;
	}
	public void setPowerAdd(int powerAdd) {
		this.powerAdd = powerAdd;
	}
	public int getPhysicalAdd() {
		return physicalAdd;
	}
	public void setPhysicalAdd(int physicalAdd) {
		this.physicalAdd = physicalAdd;
	}
	public int getAgileAdd() {
		return agileAdd;
	}
	public void setAgileAdd(int agileAdd) {
		this.agileAdd = agileAdd;
	}
	public int getWitAdd() {
		return witAdd;
	}
	public void setWitAdd(int witAdd) {
		this.witAdd = witAdd;
	}

	
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public long getPlayerId() {
		return playerId;
	}
	public void setPlayerId(long playerId) {
		this.playerId = playerId;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getQuality() {
		return quality;
	}
	public void setQuality(int quality) {
		this.quality = quality;
	}
	public int getIcon() {
		return icon;
	}
	public void setIcon(int icon) {
		this.icon = icon;
	}
	public int getLevel() {
		return level;
	}
	public void setLevel(int level) {
		this.level = level;
	}
	public int getScore() {
		return score;
	}
	public void setScore(int score) {
		this.score = score;
	}
	public Map<Integer, Integer> getDowerMap() {
		return dowerMap;
	}
	public void setDowerMap(Map<Integer, Integer> dowerMap) {
		this.dowerMap = dowerMap;
	}
	public int getCreateTime() {
		return createTime;
	}
	public void setCreateTime(int createTime) {
		this.createTime = createTime;
	}
	public int getCampId() {
		return campId;
	}
	public void setCampId(int campId) {
		this.campId = campId;
	}
	public long getExpNeed() {
		return expNeed;
	}
	public void setExpNeed(long expNeed) {
		this.expNeed = expNeed;
	}
	public long getExp() {
		return exp;
	}
	public void setExp(long exp) {
		this.exp = exp;
	}
	public int getPower() {
		return power;
	}
	public void setPower(int power) {
		this.power = power;
	}
	public int getPhysical() {
		return physical;
	}
	public void setPhysical(int physical) {
		this.physical = physical;
	}
	public int getAgile() {
		return agile;
	}
	public void setAgile(int agile) {
		this.agile = agile;
	}
	public int getWit() {
		return wit;
	}
	public void setWit(int wit) {
		this.wit = wit;
	}
	public int getFeatureType() {
		return featureType;
	}
	public void setFeatureType(int featureType) {
		this.featureType = featureType;
	}
	public int getFeatureLevel() {
		return featureLevel;
	}
	public void setFeatureLevel(int featureLevel) {
		this.featureLevel = featureLevel;
	}
	public int getPowerPercent() {
		return powerPercent;
	}
	public void setPowerPercent(int powerPercent) {
		this.powerPercent = powerPercent;
	}
	public int getPhysicalPercent() {
		return physicalPercent;
	}
	public void setPhysicalPercent(int physicalPercent) {
		this.physicalPercent = physicalPercent;
	}
	public int getAgilePercent() {
		return agilePercent;
	}
	public void setAgilePercent(int agilePercent) {
		this.agilePercent = agilePercent;
	}
	public int getWitPercent() {
		return witPercent;
	}
	public void setWitPercent(int witPercent) {
		this.witPercent = witPercent;
	}
	public int[] getPercentMax() {
		return percentMax;
	}
	public void setPercentMax(int[] percentMax) {
		this.percentMax = percentMax;
	}
	public int getQualifiedType() {
		return qualifiedType;
	}
	public void setQualifiedType(int qualifiedType) {
		this.qualifiedType = qualifiedType;
	}



	public int[] getAddV() {
		return addV;
	}



	public void setAddV(int[] addV) {
		this.addV = addV;
	}



	public int getGrowth() {
		return growth;
	}



	public void setGrowth(int growth) {
		this.growth = growth;
	}
	
	
}
